use backtrace::Backtrace;

fn main() {
    let i = 100;

    // backtrace::trace_unsynchronized(|frame| {
    //     let ip = frame.ip();
    //     let symbol_address = frame.symbol_address();

    //     // Resolve frame
    //     backtrace::resolve_frame_unsynchronized(frame, |symbol| {
    //         if let Some(name) = symbol.name() {
    //             println!("name:{}", name);
    //         }
    //         if let Some(filename) = symbol.filename() {
    //             println!("filename:{}", filename.display())
    //         }
    //     });

    //     true
    // });

    let bt = Backtrace::new();

    println!("{}", i);

    println!("backtrace:{:?}", bt)
}
